var _typeof2 = require("../../../../@babel/runtime/helpers/typeof");

(function(n, t) {
    if ("undefined" != typeof GameGlobal) return t(GameGlobal.async = GameGlobal.async || {});
    "object" == (typeof exports === "undefined" ? "undefined" : _typeof2(exports)) && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define([ "exports" ], t) : t(n.async = n.async || {});
})(void 0, function(n) {
    "use strict";
    function t(n, t) {
        t |= 0;
        for (var e = Math.max(n.length - t, 0), r = Array(e), u = 0; u < e; u++) r[u] = n[t + u];
        return r;
    }
    var e = function e(n) {
        var e = t(arguments, 1);
        return function() {
            var r = t(arguments);
            return n.apply(null, e.concat(r));
        };
    }, r = function r(n) {
        return function() {
            var e = t(arguments), r = e.pop();
            n.call(this, e, r);
        };
    };
    function u(n) {
        var t = _typeof2(n);
        return null != n && ("object" == t || "function" == t);
    }
    var i = "function" == typeof setImmediate && setImmediate, o = "object" == (typeof process === "undefined" ? "undefined" : _typeof2(process)) && "function" == typeof process.nextTick;
    function c(n) {
        setTimeout(n, 0);
    }
    function a(n) {
        return function(e) {
            var r = t(arguments, 1);
            n(function() {
                e.apply(null, r);
            });
        };
    }
    var f = a(i ? setImmediate : o ? process.nextTick : c);
    function l(n) {
        return r(function(t, e) {
            var r;
            try {
                r = n.apply(this, t);
            } catch (i) {
                return e(i);
            }
            u(r) && "function" == typeof r.then ? r.then(function(n) {
                s(e, null, n);
            }, function(n) {
                s(e, n.message ? n : new Error(n));
            }) : e(null, r);
        });
    }
    function s(n, t, e) {
        try {
            n(t, e);
        } catch (r) {
            f(p, r);
        }
    }
    function p(n) {
        throw n;
    }
    var v = "function" == typeof Symbol;
    function h(n) {
        return v && "AsyncFunction" === n[Symbol.toStringTag];
    }
    function y(n) {
        return h(n) ? l(n) : n;
    }
    function d(n) {
        return function(e) {
            var u = t(arguments, 1), i = r(function(t, r) {
                var u = this;
                return n(e, function(n, e) {
                    y(n).apply(u, t.concat(e));
                }, r);
            });
            return u.length ? i.apply(this, u) : i;
        };
    }
    var m = "object" == (typeof global === "undefined" ? "undefined" : _typeof2(global)) && global && global.Object === Object && global, g = "object" == (typeof self === "undefined" ? "undefined" : _typeof2(self)) && self && self.Object === Object && self, b = m || g || Function("", "return this")(), j = b && b.Symbol || {}, S = Object.prototype, k = S.hasOwnProperty, L = S.toString, O = j ? j.toStringTag : void 0;
    function w(n) {
        var t = k.call(n, O), e = n[O];
        try {
            n[O] = void 0;
            var r = !0;
        } catch (i) {}
        var u = L.call(n);
        return r && (t ? n[O] = e : delete n[O]), u;
    }
    var x = Object.prototype.toString;
    function E(n) {
        return x.call(n);
    }
    var A = "[object Null]", T = "[object Undefined]", B = j ? j.toStringTag : void 0;
    function F(n) {
        return null == n ? void 0 === n ? T : A : B && B in Object(n) ? w(n) : E(n);
    }
    var I = "[object AsyncFunction]", _ = "[object Function]", M = "[object GeneratorFunction]", U = "[object Proxy]";
    function q(n) {
        if (!u(n)) return !1;
        var t = F(n);
        return t == _ || t == M || t == I || t == U;
    }
    var z = 9007199254740991;
    function G(n) {
        return "number" == typeof n && n > -1 && n % 1 == 0 && n <= z;
    }
    function P(n) {
        return null != n && G(n.length) && !q(n);
    }
    var V = {};
    function D() {}
    function R(n) {
        return function() {
            if (null !== n) {
                var t = n;
                n = null, t.apply(this, arguments);
            }
        };
    }
    var C = "function" == typeof Symbol && Symbol.iterator, $ = function $(n) {
        return C && n[C] && n[C]();
    };
    function W(n, t) {
        for (var e = -1, r = Array(n); ++e < n; ) r[e] = t(e);
        return r;
    }
    function N(n) {
        return null != n && "object" == _typeof2(n);
    }
    var Q = "[object Arguments]";
    function H(n) {
        return N(n) && F(n) == Q;
    }
    var J = Object.prototype, K = J.hasOwnProperty, X = J.propertyIsEnumerable, Y = H(function() {
        return arguments;
    }()) ? H : function(n) {
        return N(n) && K.call(n, "callee") && !X.call(n, "callee");
    }, Z = Array.isArray, nn = "object" == _typeof2(n) && n && !n.nodeType && n, tn = nn && "object" == (typeof module === "undefined" ? "undefined" : _typeof2(module)) && module && !module.nodeType && module, en = tn && tn.exports === nn ? b.Buffer : void 0, rn = (en ? en.isBuffer : void 0) || function() {
        return !1;
    }, un = 9007199254740991, on = /^(?:0|[1-9]\d*)$/;
    function cn(n, t) {
        var e = _typeof2(n);
        return !!(t = null == t ? un : t) && ("number" == e || "symbol" != e && on.test(n)) && n > -1 && n % 1 == 0 && n < t;
    }
    var an = {};
    an["[object Float32Array]"] = an["[object Float64Array]"] = an["[object Int8Array]"] = an["[object Int16Array]"] = an["[object Int32Array]"] = an["[object Uint8Array]"] = an["[object Uint8ClampedArray]"] = an["[object Uint16Array]"] = an["[object Uint32Array]"] = !0, 
    an["[object Arguments]"] = an["[object Array]"] = an["[object ArrayBuffer]"] = an["[object Boolean]"] = an["[object DataView]"] = an["[object Date]"] = an["[object Error]"] = an["[object Function]"] = an["[object Map]"] = an["[object Number]"] = an["[object Object]"] = an["[object RegExp]"] = an["[object Set]"] = an["[object String]"] = an["[object WeakMap]"] = !1;
    var fn, ln = "object" == _typeof2(n) && n && !n.nodeType && n, sn = ln && "object" == (typeof module === "undefined" ? "undefined" : _typeof2(module)) && module && !module.nodeType && module, pn = sn && sn.exports === ln && m.process, vn = function() {
        try {
            return sn && sn.require && sn.require("util").types || pn && pn.binding && pn.binding("util");
        } catch (n) {}
    }(), hn = vn && vn.isTypedArray, yn = hn ? (fn = hn, function(n) {
        return fn(n);
    }) : function(n) {
        return N(n) && G(n.length) && !!an[F(n)];
    }, dn = Object.prototype.hasOwnProperty;
    function mn(n, t) {
        var e = Z(n), r = !e && Y(n), u = !e && !r && rn(n), i = !e && !r && !u && yn(n), o = e || r || u || i, c = o ? W(n.length, String) : [], a = c.length;
        for (var f in n) !t && !dn.call(n, f) || o && ("length" == f || u && ("offset" == f || "parent" == f) || i && ("buffer" == f || "byteLength" == f || "byteOffset" == f) || cn(f, a)) || c.push(f);
        return c;
    }
    var gn = Object.prototype, bn = function(n, t) {
        return function(e) {
            return n(t(e));
        };
    }(Object.keys, Object), jn = Object.prototype.hasOwnProperty;
    function Sn(n) {
        if (e = (t = n) && t.constructor, t !== ("function" == typeof e && e.prototype || gn)) return bn(n);
        var t, e, r = [];
        for (var u in Object(n)) jn.call(n, u) && "constructor" != u && r.push(u);
        return r;
    }
    function kn(n) {
        return P(n) ? mn(n) : Sn(n);
    }
    function Ln(n) {
        var t = -1, e = n.length;
        return function() {
            return ++t < e ? {
                value: n[t],
                key: t
            } : null;
        };
    }
    function On(n) {
        var t = -1;
        return function() {
            var e = n.next();
            return e.done ? null : (t++, {
                value: e.value,
                key: t
            });
        };
    }
    function wn(n) {
        if (P(n)) return Ln(n);
        var t, e, r, u, i = $(n);
        return i ? On(i) : (e = kn(t = n), r = -1, u = e.length, function() {
            var n = e[++r];
            return r < u ? {
                value: t[n],
                key: n
            } : null;
        });
    }
    function xn(n) {
        return function() {
            if (null === n) throw new Error("Callback was already called.");
            var t = n;
            n = null, t.apply(this, arguments);
        };
    }
    function En(n) {
        return function(t, e, r) {
            if (r = R(r || D), n <= 0 || !t) return r(null);
            var u = wn(t), i = !1, o = 0, c = !1;
            function a(n, t) {
                if (o -= 1, n) i = !0, r(n); else {
                    if (t === V || i && o <= 0) return i = !0, r(null);
                    c || f();
                }
            }
            function f() {
                for (c = !0; o < n && !i; ) {
                    var t = u();
                    if (null === t) return i = !0, void (o <= 0 && r(null));
                    o += 1, e(t.value, t.key, xn(a));
                }
                c = !1;
            }
            f();
        };
    }
    function An(n, t, e, r) {
        En(t)(n, y(e), r);
    }
    function Tn(n, t) {
        return function(e, r, u) {
            return n(e, t, r, u);
        };
    }
    function Bn(n, t, e) {
        e = R(e || D);
        var r = 0, u = 0, i = n.length;
        function o(n, t) {
            n ? e(n) : ++u !== i && t !== V || e(null);
        }
        for (0 === i && e(null); r < i; r++) t(n[r], r, xn(o));
    }
    var Fn = Tn(An, 1 / 0), In = function In(n, t, e) {
        (P(n) ? Bn : Fn)(n, y(t), e);
    };
    function _n(n) {
        return function(t, e, r) {
            return n(In, t, y(e), r);
        };
    }
    function Mn(n, t, e, r) {
        r = r || D, t = t || [];
        var u = [], i = 0, o = y(e);
        n(t, function(n, t, e) {
            var r = i++;
            o(n, function(n, t) {
                u[r] = t, e(n);
            });
        }, function(n) {
            r(n, u);
        });
    }
    var Un = _n(Mn), qn = d(Un);
    function zn(n) {
        return function(t, e, r, u) {
            return n(En(e), t, y(r), u);
        };
    }
    var Gn = zn(Mn), Pn = Tn(Gn, 1), Vn = d(Pn);
    function Dn(n, t) {
        for (var e = -1, r = null == n ? 0 : n.length; ++e < r && !1 !== t(n[e], e, n); ) ;
        return n;
    }
    var Rn = function Rn(n, t, e) {
        for (var r = -1, u = Object(n), i = e(n), o = i.length; o--; ) {
            var c = i[++r];
            if (!1 === t(u[c], c, u)) break;
        }
        return n;
    };
    function Cn(n, t) {
        return n && Rn(n, t, kn);
    }
    function $n(n, t, e, r) {
        for (var u = n.length, i = e + (r ? 1 : -1); r ? i-- : ++i < u; ) if (t(n[i], i, n)) return i;
        return -1;
    }
    function Wn(n) {
        return n != n;
    }
    function Nn(n, t, e) {
        for (var r = e - 1, u = n.length; ++r < u; ) if (n[r] === t) return r;
        return -1;
    }
    function Qn(n, t, e) {
        return t == t ? Nn(n, t, e) : $n(n, Wn, e);
    }
    var Hn = function Hn(n, e, r) {
        "function" == typeof e && (r = e, e = null), r = R(r || D);
        var u = kn(n).length;
        if (!u) return r(null);
        e || (e = u);
        var i = {}, o = 0, c = !1, a = Object.create(null), f = [], l = [], s = {};
        function p(n, t) {
            f.push(function() {
                d(n, t);
            });
        }
        function v() {
            if (0 === f.length && 0 === o) return r(null, i);
            for (;f.length && o < e; ) f.shift()();
        }
        function h(n) {
            Dn(a[n] || [], function(n) {
                n();
            }), v();
        }
        function d(n, e) {
            if (!c) {
                var u = xn(function(e, u) {
                    if (o--, arguments.length > 2 && (u = t(arguments, 1)), e) {
                        var f = {};
                        Cn(i, function(n, t) {
                            f[t] = n;
                        }), f[n] = u, c = !0, a = Object.create(null), r(e, f);
                    } else i[n] = u, h(n);
                });
                o++;
                var f = y(e[e.length - 1]);
                e.length > 1 ? f(i, u) : f(u);
            }
        }
        function m(t) {
            var e = [];
            return Cn(n, function(n, r) {
                Z(n) && Qn(n, t, 0) >= 0 && e.push(r);
            }), e;
        }
        Cn(n, function(t, e) {
            if (!Z(t)) return p(e, [ t ]), void l.push(e);
            var r = t.slice(0, t.length - 1), u = r.length;
            if (0 === u) return p(e, t), void l.push(e);
            s[e] = u, Dn(r, function(i) {
                if (!n[i]) throw new Error("async.auto task `" + e + "` has a non-existent dependency `" + i + "` in " + r.join(", "));
                var o, c, f;
                c = function c() {
                    0 == --u && p(e, t);
                }, (f = a[o = i]) || (f = a[o] = []), f.push(c);
            });
        }), function() {
            for (var n = 0; l.length; ) n++, Dn(m(l.pop()), function(n) {
                0 == --s[n] && l.push(n);
            });
            if (n !== u) throw new Error("async.auto cannot execute tasks due to a recursive dependency");
        }(), v();
    };
    function Jn(n, t) {
        for (var e = -1, r = null == n ? 0 : n.length, u = Array(r); ++e < r; ) u[e] = t(n[e], e, n);
        return u;
    }
    var Kn = "[object Symbol]";
    function Xn(n) {
        return "symbol" == _typeof2(n) || N(n) && F(n) == Kn;
    }
    var Yn = 1 / 0, Zn = j ? j.prototype : void 0, nt = Zn ? Zn.toString : void 0;
    function tt(n) {
        if ("string" == typeof n) return n;
        if (Z(n)) return Jn(n, tt) + "";
        if (Xn(n)) return nt ? nt.call(n) : "";
        var t = n + "";
        return "0" == t && 1 / n == -Yn ? "-0" : t;
    }
    function et(n, t, e) {
        var r = -1, u = n.length;
        t < 0 && (t = -t > u ? 0 : u + t), (e = e > u ? u : e) < 0 && (e += u), u = t > e ? 0 : e - t >>> 0, 
        t >>>= 0;
        for (var i = Array(u); ++r < u; ) i[r] = n[r + t];
        return i;
    }
    function rt(n, t, e) {
        var r = n.length;
        return e = void 0 === e ? r : e, !t && e >= r ? n : et(n, t, e);
    }
    function ut(n, t) {
        for (var e = n.length; e-- && Qn(t, n[e], 0) > -1; ) ;
        return e;
    }
    function it(n, t) {
        for (var e = -1, r = n.length; ++e < r && Qn(t, n[e], 0) > -1; ) ;
        return e;
    }
    function ot(n) {
        return n.split("");
    }
    var ct = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
    function at(n) {
        return ct.test(n);
    }
    var ft = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", lt = "\\ud83c[\\udffb-\\udfff]", st = "[^\\ud800-\\udfff]", pt = "(?:\\ud83c[\\udde6-\\uddff]){2}", vt = "[\\ud800-\\udbff][\\udc00-\\udfff]", ht = "(?:" + ft + "|" + lt + ")?", yt = "[\\ufe0e\\ufe0f]?" + ht + "(?:\\u200d(?:" + [ st, pt, vt ].join("|") + ")[\\ufe0e\\ufe0f]?" + ht + ")*", dt = "(?:" + [ st + ft + "?", ft, pt, vt, "[\\ud800-\\udfff]" ].join("|") + ")", mt = RegExp(lt + "(?=" + lt + ")|" + dt + yt, "g");
    function gt(n) {
        return n.match(mt) || [];
    }
    function bt(n) {
        return at(n) ? gt(n) : ot(n);
    }
    var jt = /^\s+|\s+$/g;
    function St(n, t, e) {
        var r;
        if ((n = null == (r = n) ? "" : tt(r)) && (e || void 0 === t)) return n.replace(jt, "");
        if (!n || !(t = tt(t))) return n;
        var u = bt(n), i = bt(t);
        return rt(u, it(u, i), ut(u, i) + 1).join("");
    }
    var kt = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m, Lt = /,/, Ot = /(=.+)?(\s*)$/, wt = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;
    function xt(n) {
        return (n = (n = (n = n.toString().replace(wt, "")).match(kt)[2].replace(" ", "")) ? n.split(Lt) : []).map(function(n) {
            return St(n.replace(Ot, ""));
        });
    }
    function Et(n, t) {
        var e = {};
        Cn(n, function(n, t) {
            var r, u = h(n), i = !u && 1 === n.length || u && 0 === n.length;
            if (Z(n)) r = n.slice(0, -1), n = n[n.length - 1], e[t] = r.concat(r.length > 0 ? o : n); else if (i) e[t] = n; else {
                if (r = xt(n), 0 === n.length && !u && 0 === r.length) throw new Error("autoInject task functions require explicit parameters.");
                u || r.pop(), e[t] = r.concat(o);
            }
            function o(t, e) {
                var u = Jn(r, function(n) {
                    return t[n];
                });
                u.push(e), y(n).apply(null, u);
            }
        }), Hn(e, t);
    }
    function At() {
        this.head = this.tail = null, this.length = 0;
    }
    function Tt(n, t) {
        n.length = 1, n.head = n.tail = t;
    }
    function Bt(n, t, e) {
        if (null == t) t = 1; else if (0 === t) throw new Error("Concurrency must not be zero");
        var r = y(n), u = 0, i = [], o = !1;
        function c(n, t, e) {
            if (null != e && "function" != typeof e) throw new Error("task callback must be a function");
            if (s.started = !0, Z(n) || (n = [ n ]), 0 === n.length && s.idle()) return f(function() {
                s.drain();
            });
            for (var r = 0, u = n.length; r < u; r++) {
                var i = {
                    data: n[r],
                    callback: e || D
                };
                t ? s._tasks.unshift(i) : s._tasks.push(i);
            }
            o || (o = !0, f(function() {
                o = !1, s.process();
            }));
        }
        function a(n) {
            return function(t) {
                u -= 1;
                for (var e = 0, r = n.length; e < r; e++) {
                    var o = n[e], c = Qn(i, o, 0);
                    0 === c ? i.shift() : c > 0 && i.splice(c, 1), o.callback.apply(o, arguments), null != t && s.error(t, o.data);
                }
                u <= s.concurrency - s.buffer && s.unsaturated(), s.idle() && s.drain(), s.process();
            };
        }
        var l = !1, s = {
            _tasks: new At(),
            concurrency: t,
            payload: e,
            saturated: D,
            unsaturated: D,
            buffer: t / 4,
            empty: D,
            drain: D,
            error: D,
            started: !1,
            paused: !1,
            push: function push(n, t) {
                c(n, !1, t);
            },
            kill: function kill() {
                s.drain = D, s._tasks.empty();
            },
            unshift: function unshift(n, t) {
                c(n, !0, t);
            },
            remove: function remove(n) {
                s._tasks.remove(n);
            },
            process: function process() {
                if (!l) {
                    for (l = !0; !s.paused && u < s.concurrency && s._tasks.length; ) {
                        var n = [], t = [], e = s._tasks.length;
                        s.payload && (e = Math.min(e, s.payload));
                        for (var o = 0; o < e; o++) {
                            var c = s._tasks.shift();
                            n.push(c), i.push(c), t.push(c.data);
                        }
                        u += 1, 0 === s._tasks.length && s.empty(), u === s.concurrency && s.saturated();
                        var f = xn(a(n));
                        r(t, f);
                    }
                    l = !1;
                }
            },
            length: function length() {
                return s._tasks.length;
            },
            running: function running() {
                return u;
            },
            workersList: function workersList() {
                return i;
            },
            idle: function idle() {
                return s._tasks.length + u === 0;
            },
            pause: function pause() {
                s.paused = !0;
            },
            resume: function resume() {
                !1 !== s.paused && (s.paused = !1, f(s.process));
            }
        };
        return s;
    }
    function Ft(n, t) {
        return Bt(n, 1, t);
    }
    At.prototype.removeLink = function(n) {
        return n.prev ? n.prev.next = n.next : this.head = n.next, n.next ? n.next.prev = n.prev : this.tail = n.prev, 
        n.prev = n.next = null, this.length -= 1, n;
    }, At.prototype.empty = function() {
        for (;this.head; ) this.shift();
        return this;
    }, At.prototype.insertAfter = function(n, t) {
        t.prev = n, t.next = n.next, n.next ? n.next.prev = t : this.tail = t, n.next = t, 
        this.length += 1;
    }, At.prototype.insertBefore = function(n, t) {
        t.prev = n.prev, t.next = n, n.prev ? n.prev.next = t : this.head = t, n.prev = t, 
        this.length += 1;
    }, At.prototype.unshift = function(n) {
        this.head ? this.insertBefore(this.head, n) : Tt(this, n);
    }, At.prototype.push = function(n) {
        this.tail ? this.insertAfter(this.tail, n) : Tt(this, n);
    }, At.prototype.shift = function() {
        return this.head && this.removeLink(this.head);
    }, At.prototype.pop = function() {
        return this.tail && this.removeLink(this.tail);
    }, At.prototype.toArray = function() {
        for (var n = Array(this.length), t = this.head, e = 0; e < this.length; e++) n[e] = t.data, 
        t = t.next;
        return n;
    }, At.prototype.remove = function(n) {
        for (var t = this.head; t; ) {
            var e = t.next;
            n(t) && this.removeLink(t), t = e;
        }
        return this;
    };
    var It = Tn(An, 1);
    function _t(n, t, e, r) {
        r = R(r || D);
        var u = y(e);
        It(n, function(n, e, r) {
            u(t, n, function(n, e) {
                t = e, r(n);
            });
        }, function(n) {
            r(n, t);
        });
    }
    function Mt() {
        var n = Jn(arguments, y);
        return function() {
            var e = t(arguments), r = this, u = e[e.length - 1];
            "function" == typeof u ? e.pop() : u = D, _t(n, e, function(n, e, u) {
                e.apply(r, n.concat(function(n) {
                    var e = t(arguments, 1);
                    u(n, e);
                }));
            }, function(n, t) {
                u.apply(r, [ n ].concat(t));
            });
        };
    }
    var Ut = function Ut() {
        return Mt.apply(null, t(arguments).reverse());
    }, qt = Array.prototype.concat, zt = function zt(n, e, r, u) {
        u = u || D;
        var i = y(r);
        Gn(n, e, function(n, e) {
            i(n, function(n) {
                return n ? e(n) : e(null, t(arguments, 1));
            });
        }, function(n, t) {
            for (var e = [], r = 0; r < t.length; r++) t[r] && (e = qt.apply(e, t[r]));
            return u(n, e);
        });
    }, Gt = Tn(zt, 1 / 0), Pt = Tn(zt, 1), Vt = function Vt() {
        var n = t(arguments), e = [ null ].concat(n);
        return function() {
            var n = arguments[arguments.length - 1];
            return n.apply(this, e);
        };
    };
    function Dt(n) {
        return n;
    }
    function Rt(n, t) {
        return function(e, r, u, i) {
            i = i || D;
            var o, c = !1;
            e(r, function(e, r, i) {
                u(e, function(r, u) {
                    r ? i(r) : n(u) && !o ? (c = !0, o = t(!0, e), i(null, V)) : i();
                });
            }, function(n) {
                n ? i(n) : i(null, c ? o : t(!1));
            });
        };
    }
    function Ct(n, t) {
        return t;
    }
    var $t = _n(Rt(Dt, Ct)), Wt = zn(Rt(Dt, Ct)), Nt = Tn(Wt, 1);
    function Qt(n) {
        return function(e) {
            var r = t(arguments, 1);
            r.push(function(e) {
                var r = t(arguments, 1);
                "object" == (typeof console === "undefined" ? "undefined" : _typeof2(console)) && (e ? console.error && console.error(e) : console[n] && Dn(r, function(t) {
                    console[n](t);
                }));
            }), y(e).apply(null, r);
        };
    }
    var Ht = Qt("dir");
    function Jt(n, e, r) {
        r = xn(r || D);
        var u = y(n), i = y(e);
        function o(n) {
            if (n) return r(n);
            var e = t(arguments, 1);
            e.push(c), i.apply(this, e);
        }
        function c(n, t) {
            return n ? r(n) : t ? void u(o) : r(null);
        }
        c(null, !0);
    }
    function Kt(n, e, r) {
        r = xn(r || D);
        var u = y(n), i = function i(n) {
            if (n) return r(n);
            var o = t(arguments, 1);
            if (e.apply(this, o)) return u(i);
            r.apply(null, [ null ].concat(o));
        };
        u(i);
    }
    function Xt(n, t, e) {
        Kt(n, function() {
            return !t.apply(this, arguments);
        }, e);
    }
    function Yt(n, t, e) {
        e = xn(e || D);
        var r = y(t), u = y(n);
        function i(n) {
            if (n) return e(n);
            u(o);
        }
        function o(n, t) {
            return n ? e(n) : t ? void r(i) : e(null);
        }
        u(o);
    }
    function Zt(n) {
        return function(t, e, r) {
            return n(t, r);
        };
    }
    function ne(n, t, e) {
        In(n, Zt(y(t)), e);
    }
    function te(n, t, e, r) {
        En(t)(n, Zt(y(e)), r);
    }
    var ee = Tn(te, 1);
    function re(n) {
        return h(n) ? n : r(function(t, e) {
            var r = !0;
            t.push(function() {
                var n = arguments;
                r ? f(function() {
                    e.apply(null, n);
                }) : e.apply(null, n);
            }), n.apply(this, t), r = !1;
        });
    }
    function ue(n) {
        return !n;
    }
    var ie = _n(Rt(ue, ue)), oe = zn(Rt(ue, ue)), ce = Tn(oe, 1);
    function ae(n) {
        return function(t) {
            return null == t ? void 0 : t[n];
        };
    }
    function fe(n, t, e, r) {
        var u = new Array(t.length);
        n(t, function(n, t, r) {
            e(n, function(n, e) {
                u[t] = !!e, r(n);
            });
        }, function(n) {
            if (n) return r(n);
            for (var e = [], i = 0; i < t.length; i++) u[i] && e.push(t[i]);
            r(null, e);
        });
    }
    function le(n, t, e, r) {
        var u = [];
        n(t, function(n, t, r) {
            e(n, function(e, i) {
                e ? r(e) : (i && u.push({
                    index: t,
                    value: n
                }), r());
            });
        }, function(n) {
            n ? r(n) : r(null, Jn(u.sort(function(n, t) {
                return n.index - t.index;
            }), ae("value")));
        });
    }
    function se(n, t, e, r) {
        (P(t) ? fe : le)(n, t, y(e), r || D);
    }
    var pe = _n(se), ve = zn(se), he = Tn(ve, 1);
    function ye(n, t) {
        var e = xn(t || D), r = y(re(n));
        (function n(t) {
            if (t) return e(t);
            r(n);
        })();
    }
    var de = function de(n, t, e, r) {
        r = r || D;
        var u = y(e);
        Gn(n, t, function(n, t) {
            u(n, function(e, r) {
                return e ? t(e) : t(null, {
                    key: r,
                    val: n
                });
            });
        }, function(n, t) {
            for (var e = {}, u = Object.prototype.hasOwnProperty, i = 0; i < t.length; i++) if (t[i]) {
                var o = t[i].key, c = t[i].val;
                u.call(e, o) ? e[o].push(c) : e[o] = [ c ];
            }
            return r(n, e);
        });
    }, me = Tn(de, 1 / 0), ge = Tn(de, 1), be = Qt("log");
    function je(n, t, e, r) {
        r = R(r || D);
        var u = {}, i = y(e);
        An(n, t, function(n, t, e) {
            i(n, t, function(n, r) {
                if (n) return e(n);
                u[t] = r, e();
            });
        }, function(n) {
            r(n, u);
        });
    }
    var Se = Tn(je, 1 / 0), ke = Tn(je, 1);
    function Le(n, t) {
        return t in n;
    }
    function Oe(n, e) {
        var u = Object.create(null), i = Object.create(null);
        e = e || Dt;
        var o = y(n), c = r(function(n, r) {
            var c = e.apply(null, n);
            Le(u, c) ? f(function() {
                r.apply(null, u[c]);
            }) : Le(i, c) ? i[c].push(r) : (i[c] = [ r ], o.apply(null, n.concat(function() {
                var n = t(arguments);
                u[c] = n;
                var e = i[c];
                delete i[c];
                for (var r = 0, o = e.length; r < o; r++) e[r].apply(null, n);
            })));
        });
        return c.memo = u, c.unmemoized = n, c;
    }
    var we = a(o ? process.nextTick : i ? setImmediate : c);
    function xe(n, e, r) {
        r = r || D;
        var u = P(e) ? [] : {};
        n(e, function(n, e, r) {
            y(n)(function(n, i) {
                arguments.length > 2 && (i = t(arguments, 1)), u[e] = i, r(n);
            });
        }, function(n) {
            r(n, u);
        });
    }
    function Ee(n, t) {
        xe(In, n, t);
    }
    function Ae(n, t, e) {
        xe(En(t), n, e);
    }
    var Te = function Te(n, t) {
        var e = y(n);
        return Bt(function(n, t) {
            e(n[0], t);
        }, t, 1);
    }, Be = function Be(n, t) {
        var e = Te(n, t);
        return e.push = function(n, t, r) {
            if (null == r && (r = D), "function" != typeof r) throw new Error("task callback must be a function");
            if (e.started = !0, Z(n) || (n = [ n ]), 0 === n.length) return f(function() {
                e.drain();
            });
            t = t || 0;
            for (var u = e._tasks.head; u && t >= u.priority; ) u = u.next;
            for (var i = 0, o = n.length; i < o; i++) {
                var c = {
                    data: n[i],
                    priority: t,
                    callback: r
                };
                u ? e._tasks.insertBefore(u, c) : e._tasks.push(c);
            }
            f(e.process);
        }, delete e.unshift, e;
    };
    function Fe(n, t) {
        if (t = R(t || D), !Z(n)) return t(new TypeError("First argument to race must be an array of functions"));
        if (!n.length) return t();
        for (var e = 0, r = n.length; e < r; e++) y(n[e])(t);
    }
    function Ie(n, e, r, u) {
        _t(t(n).reverse(), e, r, u);
    }
    function _e(n) {
        var e = y(n);
        return r(function(n, r) {
            return n.push(function(n, e) {
                var u;
                n ? r(null, {
                    error: n
                }) : (u = arguments.length <= 2 ? e : t(arguments, 1), r(null, {
                    value: u
                }));
            }), e.apply(this, n);
        });
    }
    function Me(n) {
        var t;
        return Z(n) ? t = Jn(n, _e) : (t = {}, Cn(n, function(n, e) {
            t[e] = _e.call(this, n);
        })), t;
    }
    function Ue(n, t, e, r) {
        se(n, t, function(n, t) {
            e(n, function(n, e) {
                t(n, !e);
            });
        }, r);
    }
    var qe = _n(Ue), ze = zn(Ue), Ge = Tn(ze, 1);
    function Pe(n) {
        return function() {
            return n;
        };
    }
    function Ve(n, t, e) {
        var r = {
            times: 5,
            intervalFunc: Pe(0)
        };
        if (arguments.length < 3 && "function" == typeof n ? (e = t || D, t = n) : (function(n, t) {
            if ("object" == _typeof2(t)) n.times = +t.times || 5, n.intervalFunc = "function" == typeof t.interval ? t.interval : Pe(+t.interval || 0), 
            n.errorFilter = t.errorFilter; else {
                if ("number" != typeof t && "string" != typeof t) throw new Error("Invalid arguments for async.retry");
                n.times = +t || 5;
            }
        }(r, n), e = e || D), "function" != typeof t) throw new Error("Invalid arguments for async.retry");
        var u = y(t), i = 1;
        (function n() {
            u(function(t) {
                t && i++ < r.times && ("function" != typeof r.errorFilter || r.errorFilter(t)) ? setTimeout(n, r.intervalFunc(i)) : e.apply(null, arguments);
            });
        })();
    }
    var De = function De(n, t) {
        t || (t = n, n = null);
        var e = y(t);
        return r(function(t, r) {
            function u(n) {
                e.apply(null, t.concat(n));
            }
            n ? Ve(n, u, r) : Ve(u, r);
        });
    };
    function Re(n, t) {
        xe(It, n, t);
    }
    var Ce = _n(Rt(Boolean, Dt)), $e = zn(Rt(Boolean, Dt)), We = Tn($e, 1);
    function Ne(n, t, e) {
        var r = y(t);
        function u(n, t) {
            var e = n.criteria, r = t.criteria;
            return e < r ? -1 : e > r ? 1 : 0;
        }
        Un(n, function(n, t) {
            r(n, function(e, r) {
                if (e) return t(e);
                t(null, {
                    value: n,
                    criteria: r
                });
            });
        }, function(n, t) {
            if (n) return e(n);
            e(null, Jn(t.sort(u), ae("value")));
        });
    }
    function Qe(n, t, e) {
        var u = y(n);
        return r(function(r, i) {
            var o, c = !1;
            r.push(function() {
                c || (i.apply(null, arguments), clearTimeout(o));
            }), o = setTimeout(function() {
                var t = n.name || "anonymous", r = new Error('Callback function "' + t + '" timed out.');
                r.code = "ETIMEDOUT", e && (r.info = e), c = !0, i(r);
            }, t), u.apply(null, r);
        });
    }
    var He = Math.ceil, Je = Math.max;
    function Ke(n, t, e, r) {
        for (var u = -1, i = Je(He((t - n) / (e || 1)), 0), o = Array(i); i--; ) o[r ? i : ++u] = n, 
        n += e;
        return o;
    }
    function Xe(n, t, e, r) {
        var u = y(e);
        Gn(Ke(0, n, 1), t, u, r);
    }
    var Ye = Tn(Xe, 1 / 0), Ze = Tn(Xe, 1);
    function nr(n, t, e, r) {
        arguments.length <= 3 && (r = e, e = t, t = Z(n) ? [] : {}), r = R(r || D);
        var u = y(e);
        In(n, function(n, e, r) {
            u(t, n, e, r);
        }, function(n) {
            r(n, t);
        });
    }
    function tr(n, e) {
        var r, u = null;
        e = e || D, ee(n, function(n, e) {
            y(n)(function(n, i) {
                r = arguments.length > 2 ? t(arguments, 1) : i, u = n, e(!n);
            });
        }, function() {
            e(u, r);
        });
    }
    function er(n) {
        return function() {
            return (n.unmemoized || n).apply(null, arguments);
        };
    }
    function rr(n, e, r) {
        r = xn(r || D);
        var u = y(e);
        if (!n()) return r(null);
        var i = function i(e) {
            if (e) return r(e);
            if (n()) return u(i);
            var o = t(arguments, 1);
            r.apply(null, [ null ].concat(o));
        };
        u(i);
    }
    function ur(n, t, e) {
        rr(function() {
            return !n.apply(this, arguments);
        }, t, e);
    }
    var ir = function ir(n, e) {
        if (e = R(e || D), !Z(n)) return e(new Error("First argument to waterfall must be an array of functions"));
        if (!n.length) return e();
        var r = 0;
        function u(t) {
            var e = y(n[r++]);
            t.push(xn(i)), e.apply(null, t);
        }
        function i(i) {
            if (i || r === n.length) return e.apply(null, arguments);
            u(t(arguments, 1));
        }
        u([]);
    }, or = {
        apply: e,
        applyEach: qn,
        applyEachSeries: Vn,
        asyncify: l,
        auto: Hn,
        autoInject: Et,
        cargo: Ft,
        compose: Ut,
        concat: Gt,
        concatLimit: zt,
        concatSeries: Pt,
        constant: Vt,
        detect: $t,
        detectLimit: Wt,
        detectSeries: Nt,
        dir: Ht,
        doDuring: Jt,
        doUntil: Xt,
        doWhilst: Kt,
        during: Yt,
        each: ne,
        eachLimit: te,
        eachOf: In,
        eachOfLimit: An,
        eachOfSeries: It,
        eachSeries: ee,
        ensureAsync: re,
        every: ie,
        everyLimit: oe,
        everySeries: ce,
        filter: pe,
        filterLimit: ve,
        filterSeries: he,
        forever: ye,
        groupBy: me,
        groupByLimit: de,
        groupBySeries: ge,
        log: be,
        map: Un,
        mapLimit: Gn,
        mapSeries: Pn,
        mapValues: Se,
        mapValuesLimit: je,
        mapValuesSeries: ke,
        memoize: Oe,
        nextTick: we,
        parallel: Ee,
        parallelLimit: Ae,
        priorityQueue: Be,
        queue: Te,
        race: Fe,
        reduce: _t,
        reduceRight: Ie,
        reflect: _e,
        reflectAll: Me,
        reject: qe,
        rejectLimit: ze,
        rejectSeries: Ge,
        retry: Ve,
        retryable: De,
        seq: Mt,
        series: Re,
        setImmediate: f,
        some: Ce,
        someLimit: $e,
        someSeries: We,
        sortBy: Ne,
        timeout: Qe,
        times: Ye,
        timesLimit: Xe,
        timesSeries: Ze,
        transform: nr,
        tryEach: tr,
        unmemoize: er,
        until: ur,
        waterfall: ir,
        whilst: rr,
        all: ie,
        allLimit: oe,
        allSeries: ce,
        any: Ce,
        anyLimit: $e,
        anySeries: We,
        find: $t,
        findLimit: Wt,
        findSeries: Nt,
        forEach: ne,
        forEachSeries: ee,
        forEachLimit: te,
        forEachOf: In,
        forEachOfSeries: It,
        forEachOfLimit: An,
        inject: _t,
        foldl: _t,
        foldr: Ie,
        select: pe,
        selectLimit: ve,
        selectSeries: he,
        wrapSync: l
    };
    n.default = or, n.apply = e, n.applyEach = qn, n.applyEachSeries = Vn, n.asyncify = l, 
    n.auto = Hn, n.autoInject = Et, n.cargo = Ft, n.compose = Ut, n.concat = Gt, n.concatLimit = zt, 
    n.concatSeries = Pt, n.constant = Vt, n.detect = $t, n.detectLimit = Wt, n.detectSeries = Nt, 
    n.dir = Ht, n.doDuring = Jt, n.doUntil = Xt, n.doWhilst = Kt, n.during = Yt, n.each = ne, 
    n.eachLimit = te, n.eachOf = In, n.eachOfLimit = An, n.eachOfSeries = It, n.eachSeries = ee, 
    n.ensureAsync = re, n.every = ie, n.everyLimit = oe, n.everySeries = ce, n.filter = pe, 
    n.filterLimit = ve, n.filterSeries = he, n.forever = ye, n.groupBy = me, n.groupByLimit = de, 
    n.groupBySeries = ge, n.log = be, n.map = Un, n.mapLimit = Gn, n.mapSeries = Pn, 
    n.mapValues = Se, n.mapValuesLimit = je, n.mapValuesSeries = ke, n.memoize = Oe, 
    n.nextTick = we, n.parallel = Ee, n.parallelLimit = Ae, n.priorityQueue = Be, n.queue = Te, 
    n.race = Fe, n.reduce = _t, n.reduceRight = Ie, n.reflect = _e, n.reflectAll = Me, 
    n.reject = qe, n.rejectLimit = ze, n.rejectSeries = Ge, n.retry = Ve, n.retryable = De, 
    n.seq = Mt, n.series = Re, n.setImmediate = f, n.some = Ce, n.someLimit = $e, n.someSeries = We, 
    n.sortBy = Ne, n.timeout = Qe, n.times = Ye, n.timesLimit = Xe, n.timesSeries = Ze, 
    n.transform = nr, n.tryEach = tr, n.unmemoize = er, n.until = ur, n.waterfall = ir, 
    n.whilst = rr, n.all = ie, n.allLimit = oe, n.allSeries = ce, n.any = Ce, n.anyLimit = $e, 
    n.anySeries = We, n.find = $t, n.findLimit = Wt, n.findSeries = Nt, n.forEach = ne, 
    n.forEachSeries = ee, n.forEachLimit = te, n.forEachOf = In, n.forEachOfSeries = It, 
    n.forEachOfLimit = An, n.inject = _t, n.foldl = _t, n.foldr = Ie, n.select = pe, 
    n.selectLimit = ve, n.selectSeries = he, n.wrapSync = l, Object.defineProperty(n, "__esModule", {
        value: !0
    });
});